"""tickets1 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path

from registro.views import TiendaList, TicketList
from registro.views import TiendaDetailView, TicketDetailView, TicketGenerarSVG, \
     TiendaCreateView, TiendaUpdateView,\
     PrecioList, PrecioCreateView, PrecioUpdateView, PrecioDetailView,\
     GrupoTicketsList, GrupoTicketsDetailView, GrupoTicketsCreateView, GrupoTicketsUpdateView, \
     TicketCreateView, TicketUpdateView, TicketGenerarPDF, ticketGenerarPdfs,\
     menuView, GrupoTicketsGenerarPdfIndividual

urlpatterns = [
    path('', menuView, name='menu'),
    path('admin/', admin.site.urls),
    # tiendas
    path('tiendas/', TiendaList.as_view(), name='lista-tiendas'),
    path('tiendas/<int:pk>/', TiendaDetailView.as_view(), name='tienda-detalles'),
    path('tiendas/new', TiendaCreateView.as_view(), name='tienda-create'),
    path('tiendas/<int:pk>/update', TiendaUpdateView.as_view(), name='tienda-update'),
    # precios
    path('precios/', PrecioList.as_view(), name='lista-precios'),
    path('precios/new', PrecioCreateView.as_view(), name='precio-create'),
    path('precios/<int:pk>/update', PrecioUpdateView.as_view(), name='precio-update'),
    path('precios/<int:pk>/', PrecioDetailView.as_view(), name='precio-detalles'),
    
    # grupo de tickets
    path('gtickets/', GrupoTicketsList.as_view(), name='gtickets'),
    path('gtickets/<int:pk>/', GrupoTicketsDetailView.as_view(), name='gtickets-detalles'),
    path('gtickets/new', GrupoTicketsCreateView.as_view(), name='gtickets-create'),
    path('gtickets/<int:pk>/update', GrupoTicketsUpdateView.as_view(), name='gtickets-update'),
    path('gtickets/<int:pk>/genpdf', GrupoTicketsGenerarPdfIndividual.as_view(), name='gtickets-pdf'),
    # tickets
    path('tickets/new', TicketCreateView.as_view(), name='ticket-create'),
    path('tickets/<uuid:pk>/update', TicketUpdateView.as_view(), name='ticket-update'),
    path('tickets/', TicketList.as_view(), name='lista-tickets'),
    path('tickets/<uuid:pk>/', TicketDetailView.as_view(), name='ticket-detalles'),
    path('tickets/<uuid:pk>/getsvg', TicketGenerarSVG.as_view(), name='ticket-generarsvg'),
    path('tickets/<uuid:pk>/getpdf', TicketGenerarPDF.as_view(), name='ticket-generarpdf'),
    path('tickets/getpdfs', ticketGenerarPdfs, name='ticket-generarpdfs'),
]
